package us.icitap.cm.business.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.eclipse.persistence.annotations.Customizer;

import us.icitap.cm.utils.MyCustomizer;

@Entity
@Customizer(MyCustomizer.class)
@Table(name="CONTROL_APP_ENTITY_FOUND",schema="MPC")
@IdClass(ControlAppEntityFoundId.class)
public class ControlAppEntityFound implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4799182217776056230L;

	public enum ItemIdentificationEnum{
		CONSIGN("Dorezuar me iniciative nga pronari/poseduesi"),
		FOUND("Gjetur gjate kontrollit");
		
		private String caption;
		private ItemIdentificationEnum(String caption){
			this.caption = caption;
		}
		
		public String getCaption(){
			return this.caption;
		}
	}
	
	public enum ItemStatusEnum{
		SEIZED("Sekuestruar"),
		STORAGE("Lenie ne ruajtje");
		
		private String caption;
		private ItemStatusEnum(String caption){
			this.caption = caption;
		}
		
		public String getCaption(){
			return this.caption;
		}
	}
	
	@Id
	@Column(name="CONTROL_ID", insertable=false, updatable=false)
	private Integer controlId;
	
	@Id
	@Column(name="APP_ENTITY_ID", insertable=false, updatable=false)
	private Integer appEntityId;
	
	@ManyToOne
	@JoinColumn(name="CONTROL_ID")
	private Control control;
	
	@ManyToOne
	@JoinColumn(name="APP_ENTITY_ID")
	private AppEntity appEntity;
	
	@Enumerated(EnumType.STRING)
	@Column(name="ITEM_IDENTIFICATION")
	private ItemIdentificationEnum itemIdentificationEnum;
	
	@Enumerated(EnumType.STRING)
	@Column(name="ITEM_STATUS")
	private ItemStatusEnum itemStatusEnum;

	public Integer getControlId() {
		return controlId;
	}

	public void setControlId(Integer controlId) {
		this.controlId = controlId;
	}

	public Integer getAppEntityId() {
		return appEntityId;
	}

	public void setAppEntityId(Integer appEntityId) {
		this.appEntityId = appEntityId;
	}

	public Control getControl() {
		return control;
	}

	public void setControl(Control control) {
		this.control = control;
	}

	public AppEntity getAppEntity() {
		return appEntity;
	}

	public void setAppEntity(AppEntity appEntity) {
		this.appEntity = appEntity;
	}

	public ItemIdentificationEnum getItemIdentificationEnum() {
		return itemIdentificationEnum;
	}

	public void setItemIdentificationEnum(
			ItemIdentificationEnum itemIdentificationEnum) {
		this.itemIdentificationEnum = itemIdentificationEnum;
	}

	public ItemStatusEnum getItemStatusEnum() {
		return itemStatusEnum;
	}

	public void setItemStatusEnum(ItemStatusEnum itemStatusEnum) {
		this.itemStatusEnum = itemStatusEnum;
	}
	
	
	
	
	
}
